import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { GuidanceHistoryVO, GuidanceHistoryForm, GuidanceHistoryQuery } from '@/api/stroke/guidanceHistory/types';

/**
 * 查询指导视频播放状态列表
 * @param query
 * @returns {*}
 */

export const listGuidanceHistory = (query?: GuidanceHistoryQuery): AxiosPromise<GuidanceHistoryVO[]> => {
  return request({
    url: '/stroke/guidanceHistory/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询指导视频播放状态详细
 * @param id
 */
export const getGuidanceHistory = (id: string | number): AxiosPromise<GuidanceHistoryVO> => {
  return request({
    url: '/stroke/guidanceHistory/' + id,
    method: 'get'
  });
};

/**
 * 新增指导视频播放状态
 * @param data
 */
export const addGuidanceHistory = (data: GuidanceHistoryForm) => {
  return request({
    url: '/stroke/guidanceHistory',
    method: 'post',
    data: data
  });
};

/**
 * 修改指导视频播放状态
 * @param data
 */
export const updateGuidanceHistory = (data: GuidanceHistoryForm) => {
  return request({
    url: '/stroke/guidanceHistory',
    method: 'put',
    data: data
  });
};

/**
 * 删除指导视频播放状态
 * @param id
 */
export const delGuidanceHistory = (id: string | number | Array<string | number>) => {
  return request({
    url: '/stroke/guidanceHistory/' + id,
    method: 'delete'
  });
};
